barplot
instacart %>%
count(department) %>%
mutate(department = fct_reorder(department, n)) %>%
plot_ly(x = ~department, y = ~n, color = ~department, type = "bar")
## Warning in RColorBrewer::brewer.pal(N, "Set2"): n too large, allowed maximum for palette Set2 is 8
## Returning the palette you asked for with that many colors
boxplot
instacart %>%
mutate(departnemt = fct_reorder(department, order_hour_of_day)) %>%
plot_ly(x = ~department, y = ~order_hour_of_day, color = ~department, type = "box")
## Warning in RColorBrewer::brewer.pal(N, "Set2"): n too large, allowed maximum for palette Set2 is 8
## Returning the palette you asked for with that many colors